package com.irdstudio.apicenter.console.service.appframe;

import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.irdstudio.apicenter.console.dm.AppModuleParam;
import com.irdstudio.apicenter.console.dm.AppModuleParamDao;

@Service(value = "appModuleParamService")
public class AppModuleParamService {
	@Autowired
	private AppModuleParamDao appModuleParamDao;

	/**
	 * 获取模块信息
	 * 
	 * @param id
	 * @param name
	 * @param pageNowe
	 * @param pageSiz
	 * @return
	 * @throws SQLException
	 * @throws ClassNotFoundException
	 */
	public AppModuleParam queryAppModuleParam(String appId, String moduleId,
			String paramCode) throws SQLException, ClassNotFoundException {

		return appModuleParamDao.queryWithKeys(appId, moduleId, paramCode);

	}

	public List<AppModuleParam> queryAppModuleParamList(String appId,
			String moduleId) throws SQLException, ClassNotFoundException {

		return appModuleParamDao.querybyAppidAndModuleid(appId, moduleId);

	}

	public int updateModuleParam(String app_id, String module_id,
			String param_code, String param_value) throws SQLException,
			ClassNotFoundException {

		// return appModuleParamDao.updateByKeys(appModuleParam);
		return appModuleParamDao.updateByKeys(app_id, module_id, param_code,
				param_value);

	}

	public int addModuleParam(String sql) throws SQLException,
			ClassNotFoundException {

		return appModuleParamDao.insert(sql);

	}

}
